package com.infowarelab.mobex.web.action;

import javax.servlet.http.HttpSession;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class IndexController {
	private static final Logger log = Logger.getLogger(IndexController.class);

	@RequestMapping(value = { "/", "", "/*.html" }, method = RequestMethod.GET)
	public ModelAndView index0(HttpSession session) {
		ModelAndView modelAndView = new ModelAndView("redirect:/index.html");
		return modelAndView;
	}

	@RequestMapping("/index.html")
	public ModelAndView index() {
		ModelAndView mav = new ModelAndView("/front/index.html");

		log.info("index.....");
		return mav;
	}

	@RequestMapping("/test{viewId}.html")
	public ModelAndView test1(@PathVariable String viewId) {
		ModelAndView mav = new ModelAndView("/front/test" + viewId + ".html");

		return mav;
	}

	@RequestMapping("/w3cschool{viewId}.html")
	public ModelAndView w3cschool(@PathVariable String viewId) {
		ModelAndView mav = new ModelAndView("/front/w3cschool" + viewId + ".html");

		return mav;
	}
	
	@RequestMapping("/login.html")
	public ModelAndView login() {
		ModelAndView mav = new ModelAndView("/front/login.html");

		log.info("login.....");
		return mav;
	}
	/*
	 * @RequestMapping("/test2.html") public ModelAndView test2() { ModelAndView
	 * mav = new ModelAndView("/front/test2.html");
	 * 
	 * return mav; }
	 * 
	 * @RequestMapping("/test3.html") public ModelAndView test3() { ModelAndView
	 * mav = new ModelAndView("/front/test3.html");
	 * 
	 * return mav; }
	 */

}
